<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="${basePath}/css/register.css"/>
<link rel="stylesheet" type="text/css" href="${basePath}/css/user.css"/>
<link rel="stylesheet" type="text/css" href="${basePath}/css/form.css"/>
<script type="text/javascript">
	var contextPath = '${basePath}'; // 上下文 js 使用
</script>
<script type="text/javascript" src="${basePath}/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="${basePath}/js/jquery.validate-1.5.js"></script>
<script type="text/javascript" src="${basePath}/js/base.js"></script> 					<!-- 常用 js -->
<script type="text/javascript" src="${basePath}/js/core.js"></script> 	
<script type="text/javascript" src="${basePath}/js/pager.js"></script> 	
<title>MSN人才网--个人会员注册</title>

<style type="text/css">
</style>


<script language="JavaScript">


var patn = /\.jpg$|\.png$|\.bmp$|\.jpeg$|\.gif$/i;
function ck(){
var ph = document.getElementById("upload");    
	 if(patn.test(ph.value)){
	  return true;
	 }else{
	 alert('请选择图片格式。');
	 return false;
	 }
	 return false;
 }


function doDisAblePic(flag){
	var url="${basePath}/user/person!doDisAble.do?p=1&rmd="+Math.random();;
    var params={"flag":flag};
	jQuery.post(url,params,function(data){
		if("true"==$.trim(data)){
			alert('操作成功！');
			loadwindow("${basePath}/user/person!goToPic.do");
            return ;
	     }else{
        alert(data);
		   }

		});
}

function doDelPic(){
	var url="${basePath}/user/person!doDelPic.do?p=1&rmd="+Math.random();
	var picname =$('#picname').val();
	if(picname==""){
     return ;
	}
    var params={"picname":picname};
	jQuery.post(url,params,function(data){
		if("true"==$.trim(data)){
			alert('删除图片成功！');
			//window.location.href="${basePath}/user/person!goToPic.do";
			loadwindow("${basePath}/user/person!goToPic.do");
            return ;
	     }else{
        alert(data);
		   }
		});
}

</script>

</head>
<body>


<div class="mean">
  <!-- 引入侧面导航栏 -->
  <%@include file="left_menu.jsp" %>

  <div class="clearance">&nbsp;</div>
  
  
  <form method="post"  name="personForm" id="personForm" action="doUpload!doPic.action" enctype="multipart/form-data" onsubmit="return ck();">	
  
  <div class="right-content">
      <!--start by 个人帐号-->
      <div class="individual">
        <div class="individual_message">上传照片</div>
        <div class="individual_message_2">
          <dl>
            <dt class="photo">
            <div>请选择登记照片：</div>
            <div>
            <input name="upload" type="file"  id="upload"  size="30" onchange="ck()"/>
            </div>
           
           <input type="submit" value="上传图片"  class="buttom_photo"/>
            
           <c:if test="${picinfo.photopb =='1'}">
		<input type="button" name="pbimg" onclick="doDisAblePic('0')" value="屏蔽图片" class="buttom_photo"/>
		</c:if>
			<c:if test="${picinfo.photopb =='0'}">
		<input type="button" name="pbimg" onclick="doDisAblePic('1')"  value="恢复照片" class="buttom_photo"/>
		</c:if>
          
           <div>   
          <input type="button"  onclick="doDelPic()" value="删除原来图片"  class="buttom_photo"/>
		<input type="hidden" name="photopb" value="${picinfo.photopb}" />
		<input type="hidden" name="phototre" value="${picinfo.phototre}" />
		<input type="hidden" name="picname" id="picname" value="${picinfo.photo}" />
            </div>
            </dt>
            <dd class="no_pic">
           <c:if test="${picinfo.photo !=''}">
           	<c:if test="${picinfo.photopb =='1'}">
            <img src="${basePath}/uploadfile/photo/${picinfo.photo}" alt="${picinfo.username}" width="120" height="150"/>
            </c:if>
             <c:if test="${picinfo.photopb =='0'}">
            <img src="${basePath}/image/nopic.gif" alt="${picinfo.username}" width="120" height="150"/>
            </c:if>
            
            </c:if>
               <c:if test="${picinfo.photo ==''}">
            <img src="${basePath}/image/nopic.gif" alt="${picinfo.username}" width="120" height="150"/>
            </c:if>
            </dd>
          </dl>
          <div class="clear buttom"></div>
          <div class="prompt">
          <p>上传照片要求如下： </p>
          <p>所传照片一律为JPG、JPEG、或GIF格式;</p>
          <p>相片大小不能超过100K。为了使您的照片显示达到最佳效果;</p>
          <p>照片应该处理成大小为145 x 200 像素。</p>
          </div>
        </div>
        
        
        </div>
     
       </form>
       
       
   </div>
  
 
  



  
</body>
</html>

